<?php
	// 加载公共文件
	include_once('../../public/config/config.php');
	include_once('../../public/config/sql.php');
	include_once('../../public/packfunc/strPoseJump.php');

	$obj = new sql($info); //实例化对象

	// 接收post传值
	$file     =  isset($_FILES['file']) ? $_FILES['file'] : '';
	$name     =  isset($_POST['name']) ? $_POST['name'] : '';
	$users    =  isset($_POST['users']) ? $_POST['users'] : '';
	$passOne  =  isset($_POST['passOne']) ? md5($_POST['passOne']) : '';
	$email    =  isset($_POST['email']) ? $_POST['email'] : '';
	$state    =  isset($_POST['state']) ? $_POST['state'] : '';
	$content  =  isset($_POST['content']) ? $_POST['content'] : '';
	$id       =  isset($_POST['id']) ? $_POST['id'] : '';

	// 删除原图片的处理
	$obj->db_raw_img('users', $id);

	// 文件处理上传
	$file = new strPoseJump($file);
	$upload = $file->arry[0];

	$val = "img='$upload',name='$name',username='$users',password='$passOne',email='$email',state='$state',content='$content'";

	if($obj->db_update('users', $val, $id)){

		header('location:../delayJump.php?param=users_list');
	}else{

		header('location:../index.php?param=users_update&id='.$id);
	}
?>